#ifndef MAC_LABEL_H
#define MAC_LABEL_H

enum dtype_mac_label {
	TYPE(MAC_LABEL)=0x4220
};
enum subtype_mac_label {
	SUBTYPE(MAC_LABEL,LABEL)=0x1,
	SUBTYPE(MAC_LABEL,SUBJECT),
	SUBTYPE(MAC_LABEL,POSITION),
	SUBTYPE(MAC_LABEL,RECORD),
	SUBTYPE(MAC_LABEL,OBJECT),
	SUBTYPE(MAC_LABEL,ADDR)
};

enum flag_sec_class
{
	R=0x01,
	F=0x02,
	M=0x04,
	A=0x08	
};

typedef struct mac_label_label{
	UINT16 sec_class;
	BYTE sec_label;
	BYTE inte_label;
}__attribute__((packed)) RECORD(MAC_LABEL,LABEL);

typedef struct mac_label_subject{
	char * user_name;
	char user_id[8];
	RECORD(MAC_LABEL,LABEL) label;
}__attribute__((packed)) RECORD(MAC_LABEL,SUBJECT);

typedef struct mac_label_position{
	char position[8];
	char department[16];
	UINT16 class;
	int level;
}__attribute__((packed)) RECORD(MAC_LABEL,POSITION);

typedef struct mac_label_record{
	char * name;
	BYTE isleveladjust;
	BYTE isselfdefine;
	UINT16 class;
	int level_fix;
	int level_adjust;
}__attribute__((packed)) RECORD(MAC_LABEL,RECORD);

typedef struct mac_label_object{
	char * user_name;
	BYTE user_id[32];
	BYTE record_name[32];
	RECORD(MAC_LABEL,LABEL) label;
}__attribute__((packed)) RECORD(MAC_LABEL,OBJECT);

typedef struct mac_label_addr{
	BYTE node_uuid[32];
	char proc_name[32];
	char * user_name;
}__attribute__((packed)) RECORD(MAC_LABEL,ADDR);

#endif
